package com.demo.intentdemo;

import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class SecondActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
        Intent intent = getIntent();
        ComponentName comp = intent.getComponent();
        String clsName = comp.getClassName();
        String act = intent.getAction();
        TextView txtView = (TextView) findViewById(R.id.txt2);
        txtView.setText("Class:" + clsName + "\nAction:" + act);
    }
}
